package blog.entity;

import lombok.Data;

/**
 * 分类
 */
@Data
public class Category {
    private Integer categoryId;

    //所属父级id
    private Integer categoryPid;

    //分类名称
    private String categoryName;

    //分类描述
    private String categoryDescription;

    //分类排序
    private Integer categoryOrder;

    //分类图标
    private String categoryIcon;

    //文章数量(非数据库字段)
    private Integer articleCount;

    public Category() {
    }

    public Category(Integer categoryId, Integer categoryPid, String categoryName, String categoryDescription, Integer categoryOrder, String categoryIcon, Integer articleCount) {
        this.categoryId = categoryId;
        this.categoryPid = categoryPid;
        this.categoryName = categoryName;
        this.categoryDescription = categoryDescription;
        this.categoryOrder = categoryOrder;
        this.categoryIcon = categoryIcon;
        this.articleCount = articleCount;
    }

    public Category(Integer categoryId, String categoryName) {
        this.categoryId = categoryId;
        this.categoryName = categoryName;
    }

    public Category(Integer categoryId) {
        this.categoryId = categoryId;
    }

    /**
     * 未分类
     *
     * @return 分类
     */
    public static Category getDefault() {
        return new Category(100000000, "未分类");
    }

}